/**
 * com.monte.permission.model.PermissionItem.java
 * create by FengMy from 2013
 */
package com.monte.permission.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import com.monte.entity.DataEntity;

/**
 * @描述: 权限项
 * 基于对方法级的控制,注册了方法全名称后,通过拦截器进行权限拦截控制
 * @author FengMy
 * @since 2013-3-25
 */
@Entity(name="T_PM_PERMISSIONITEM")
public class PermissionItem extends DataEntity {
	private static final long serialVersionUID = -8481639158876436395L;
	
	/**
	 * 注册的方法
	 */
	@Column(name="FMETHOD",length=120,nullable=false)
	private String method;
	
	/**
	 * 所属权限组
	 */
	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name="FKGROUPID")
	private PermissionGroup group;
	
	/**
	 * 是否启动控制
	 */
	@Column(name="FENABLE")
	private boolean enable;

	public PermissionGroup getGroup() {
		return group;
	}

	public void setGroup(PermissionGroup group) {
		this.group = group;
	}

	public String getMethod() {
		return method;
	}

	public void setMethod(String method) {
		this.method = method;
	}

	public boolean isEnable() {
		return enable;
	}

	public void setEnable(boolean enable) {
		this.enable = enable;
	}
}
